//direction of optimization
//$Id: optimization_direction.h 395 2010-03-26 14:01:03Z Oleg.Bulychov $
#pragma once

#include <functional>
//__________________________________________________________________________________
enum
{
    OPT_MINIMIZE = 0,
    OPT_MAXIMIZE = 1
};
//__________________________________________________________________________________
template<typename T = int>
struct maximization:
    public std::greater<T>
{
    enum { direction = OPT_MAXIMIZE };
};
//__________________________________________________________________________________
template<typename T = int>
struct minimization:
    public std::less<T>
{
    enum { direction = OPT_MINIMIZE };
};
//__________________________________________________________________________________
template<typename T> struct inverted_direction;

template<typename T>
struct inverted_direction< maximization<T> >
{
    typedef minimization<T> result;
};

template<typename T>
struct inverted_direction< minimization<T> >
{
    typedef maximization<T> result;
};

//EOF!
